﻿<!--#include file="rss_writer.asp" -->
<%
' Example for generating RSS or RDF Site Summary valid files.
' The file is commented, to be as a simple manual as i hate to write manuals :)
' First thing to do is to include the rss writer file, as the first line above.


	Response.CacheControl = "no-cache"	' Not to allow the server/browser cache this page
	Response.Expires = -1				' Not to allow the server/browser cache this page
	Response.ContentType = "text/xml"	' In case you view the file in a browser, you will see XML parsed file (IE)

	rssVer = request.querystring("ver")	' For the testing, adding "?ver=1" will produce RSS v1.0

	' First step is to create an instance of the class
	set rss = new kwRSS_writer	

	' ******* SET UP THE MAIN RSS CHANNEL PARAMETERS
		' Sets the title of rss file
		rss.ChannelTitle = "WebDev News"	

		' Sets the site url in the rss file (should be complete with http:// as who will use the rss file will be another site
		rss.ChannelURL   = "http://www.kattanweb.com/webdev"

		' Sets the description for the rss file
		rss.ChannelDesc  = "WebDev Development Site latest news, articles, codes, snippets..."

		' Sets the URL of the rss itself (needed only for RDF files)
		rss.ChannelRSSURI = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("SCRIPT_NAME")

		' Sets the language of the rss file, for RSS v1.0 it is not in the specifications.
		rss.ChannelLanguage= "en_US"


		' Sets the title of the textinput form, will be used in my reader class as the button text
		' NOTE: If this value is not set, the textinput will not be included in the RSS file.
		rss.TextInputTitle = "Search"

		' Sets the description of the textinput form, will be used in my reader class as description of the form
		rss.TextInputDesc  = "Search my site"

		' Sets the input element name of the textinput form, will be used in my reader class as text input name.
		rss.TextInputName  = "sk"

		' Sets the url of the textinput form, will be used in my reader class as the post URL
		rss.TextInputURL   = "http://www.kattnweb.com/webdev/search.asp"


		' Sets the title of the image, will be used in my reader class as "alt" text of the image
		' NOTE: If this value is not set, the image will not be included in the RSS file.
		rss.ImageTitle     = "WebDev Logo"

		' Sets the url of the image, will be used in my reader class as image itself
		rss.ImageURL	   = "http://localhost/webdev/images/WebDev_Site.jpg"

		' Sets the link of the image, will be used in my reader class as the link of the image.
		' NOTE: If this value is not set, the image will not be clickable
		rss.ImageLink      = "http://www.kattanweb.com/webdev"
	' ******* END SET UP THE MAIN RSS CHANNEL PARAMETERS


		
	' ******* ADDING ITEMS TO THE RSS CHANNEL FILE
		' NOTE: every added article will be the last in the list, for ex, first addition will
		'       add the top item, the next addition will add the second one.
		'       so, the logical order of news should be latest added first ...
		'
		' AddNew will create a new empty item
		rss.AddNew

		' Sets the title of the item
		rss.SetTitle "kwRSS Project"
		
		' Sets the link of the item
		rss.SetLink	 "http://www.kattanweb.com/webdev/projects/?id=7"
		
		' Sets the description of the item
		' NOTE: If this value is not set:
		'       - in RSS version 0.91 the description tag will not be added 
		'       - in RSS version 1.0 the description tag will be added empty <description />
		rss.SetDesc  "Project for writing and reading RSS channel information, in 2 formats, the official rdf v1.0 format and the most used v0.91 format."

	' **** The above method (adding items) can be repeated as much as you want.

		rss.AddNew
		rss.SetTitle "kwRSS Project (release candidate version)"
		rss.SetLink	 "http://www.kattanweb.com/webdev/projects/?id=72"
		rss.SetDesc  "Project for writing and reading RSS channel information, in 2 formats, the official rdf v1.0 format and the most used v0.91 format."

		rss.AddNew
		rss.SetTitle "kwRSS Project (beta version)"
		rss.SetLink	 "http://www.kattanweb.com/webdev/projects/?id=73"
		rss.SetDesc  "Project for writing and reading RSS channel information, in 2 formats, the official rdf v1.0 format and the most used v0.91 format."

	' Finally you need to get you RSS file, here you can take the one suitable for you:
	' - To get RSS version 0.91 call the "GetRSS" method.
	' - To get RSS version 1.0 call the "GetRDF" method.
		if rssVer = 1 then
			response.write rss.GetRDF
		else
			response.write rss.GetRSS
		end if
	Set rss = nothing
%>